package com.dingup.provider.service.sys;

import com.dingup.api.adapter.user.SysUserAdapter;
import com.dingup.api.bean.page.PageData;
import com.dingup.api.bean.response.SelectBean;
import com.dingup.api.model.sys.SysUser;

import java.util.List;

/**
 * Created by wancheng on 2018/7/23.
 */
public interface SysUserService {

    String loadByDingTalkUser(String cacheId);

    void loadDingTalkRole();

    void loadDingTalkDept();

    List<SysUser> listAllUser();

    List<SysUser> getUserByDeptId(Long deptId);

    List<SysUser> getUserByDeptIds(List<Long> deptIds);

    List<String> getUserIdByDeptIds(List<Long> deptIds);

    List<String> getUserIdByDeptIds(Long deptIds);

    Boolean save(SysUser user, Long deptId, List<Integer> roleIds, List<Integer> subjectIds);

    String save(SysUser user, Long[] deptId, List<Integer> roleIds);

    Boolean delete(String userId);

    Boolean active(String userId);

    Boolean selectUserIfExistByAccount(String Account);

    Boolean selectUserIfExistByEmail(String email);

    List<SysUserAdapter> getUserByUserNameOrAccount(String query, Boolean ifExternalUser);

    public void updatePassword(String userAccount,String password) throws Exception;

    String getUserNameById(String userId);

    List<SelectBean> getAllUserNameAndUserIds();

    List<SelectBean> getUserFromSysten();

    /**
     * 通过 部门和创建人 获取用户相关信息 身份
     * @param deptIds  部门
     * @param userIds  用户id
     * @param query     查询条件
     * @param ifExternalUser 是否是外部员工
     * @param page
     * @param rows
     * @return
     */
    PageData<SysUserAdapter> getUserByDeptIdsAndCreateUser(List<Long> deptIds, List<String> userIds, String query, Boolean ifExternalUser, Integer page, Integer rows);
}
